package com.fingard.dsp.bank.reqrespobj.elecbillquery;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RetAtsBase;
import com.fingard.xml.XmlTextWriter;

/**
 * Created by dell on 2017/10/31.
 */
public class RetAtsB004BillFrontQry extends RetAtsBase {
    public String respCode;
    public String respInfo;

    //电子票据
    public String billNo;
    //票据类型 1-银承 2-商承
    public String billType;
    //出票日
    public String issDate;
    //到期日
    public String dueDate;
    //电子票据金额
    public String billAmt;

    //背书转让标识 1-可再转让 0-不得转让
    public String transFlag;
    //承兑无条件支付委托 1-无条件支付 0-非条件支付
    public String mustPay;
    //出票人
    public String drawName;
    //出票人组织代码
    public String drawCode;
    //出票人账号
    public String drawAct;

    //出票人开户行行名
    public String drawBnkName;
    //出票人开户行行号
    public String drawBnkCode;

    //出票人信用等级
    public String creditLv;
    //出票人信用评级机构
    public String gradeAgent;
    //出票人评级到期日
    public String gradeDueDate;
    //出票保证人名称
    public String drGuarName;
    //出票保证人地址
    public String drGuarAddr;
    //出票保证日期
    public String drGuarDate;

    //承兑人名称
    public String accpName;
    //承兑人账号
    public String accpAct;
    //承兑人开户行行名
    public String accpBnkName;
    //承兑人开户行行号
    public String accpBnkCode;
    //承兑人信用等级
    public String accpCredit;
    //承兑人评级机构
    public String accpGrade;

    //承兑人评级到期日
    public String accpGradeDue;
    //承兑保证人名称
    public String apGuarName;
    //承兑保证人地址
    public String apGuarAddr;
    //承兑保证日期
    public String apGuarDate;

    //收款人名称
    public String payeeName;
    //收款人账号
    public String payeeAct;

    //收款人开户行行名
    public String payeeBnkName;
    //收款人开户行行号
    public String payeeBnkCode;
    //票据状态
    public String billState;

    //民生银行项目增加字段
    public String accpDate;//承兑日(格式：yyyy-MM-dd)
    public String contractNo;//合同文本编号
    public String invoiceNo;//发票号
    public String billBeforeOwner;//交易前手

    public RetAtsB004BillFrontQry(ReqRespHeader p_header) {
        retHeader = p_header;
        retXmlWriter = new XmlTextWriter();//用于输出返回ATS的XML报文
    }

    public void head() {
        writeStart();//写返回ATS的统一头部信息
    }

    public void writeRetDetail() {
        retXmlWriter.writeStartElement("DetailRecord");
        retXmlWriter.writeElementString("RespCode", respCode);
        retXmlWriter.writeElementString("RespInfo", respInfo);
        retXmlWriter.writeElementString("BillNo", billNo);
        retXmlWriter.writeElementString("BillType", billType);
        retXmlWriter.writeElementString("IssDate", issDate);
        retXmlWriter.writeElementString("DueDate", dueDate);
        retXmlWriter.writeElementString("BillAmt", billAmt);

        retXmlWriter.writeElementString("TransFlag", transFlag);
        retXmlWriter.writeElementString("MustPay", mustPay);
        retXmlWriter.writeElementString("DrawName", drawName);
        retXmlWriter.writeElementString("DrawCode", drawCode);
        retXmlWriter.writeElementString("DrawAct", drawAct);

        retXmlWriter.writeElementString("DrawBnkName", drawBnkName);
        retXmlWriter.writeElementString("DrawBnkCode", drawBnkCode);
        retXmlWriter.writeElementString("AccpAct", accpAct);

        retXmlWriter.writeElementString("AccpBnkName", accpBnkName);
        retXmlWriter.writeElementString("AccpBnkCode", accpBnkCode);
        retXmlWriter.writeElementString("AccpName", accpName);
        retXmlWriter.writeElementString("PayeeName", payeeName);
        retXmlWriter.writeElementString("PayeeAct", payeeAct);

        retXmlWriter.writeElementString("PayeeBnkName", payeeBnkName);
        retXmlWriter.writeElementString("PayeeBnkCode", payeeBnkCode);
        retXmlWriter.writeElementString("BillState", billState);
        retXmlWriter.writeElementString("CreditLv", creditLv);
        retXmlWriter.writeElementString("GradeAgent", gradeAgent);
        retXmlWriter.writeElementString("GradeDueDate", gradeDueDate);
        retXmlWriter.writeElementString("DrGuarName", drGuarName);
        retXmlWriter.writeElementString("DrGuarAddr", drGuarAddr);
        retXmlWriter.writeElementString("DrGuarDate", drGuarDate);
        retXmlWriter.writeElementString("AccpCredit", accpCredit);
        retXmlWriter.writeElementString("AccpGrade", accpGrade);
        retXmlWriter.writeElementString("AccpGradeDue", accpGradeDue);
        retXmlWriter.writeElementString("ApGuarName", apGuarName);
        retXmlWriter.writeElementString("ApGuarAddr", apGuarAddr);
        retXmlWriter.writeElementString("ApGuarDate", apGuarDate);

        //民生SAAS项目新增
        retXmlWriter.writeElementString("AccpDate", accpDate);
        retXmlWriter.writeElementString("ContractNo", contractNo);
        retXmlWriter.writeElementString("InvoiceNo", invoiceNo);
        retXmlWriter.writeElementString("BillBeforeOwner", billBeforeOwner);
        retXmlWriter.writeEndElement();
    }

    public void writeAfter() {
        writeEnd();//写结束
    }
}
